package com.l2jserver.gameserver.scripting.scriptengine.listeners.talk;

import com.l2jserver.gameserver.network.clientpackets.DlgAnswer;
import com.l2jserver.gameserver.scripting.scriptengine.events.DlgAnswerEvent;
import com.l2jserver.gameserver.scripting.scriptengine.impl.L2JListener;

/**
 * @author UnAfraid
 */
public abstract class DlgAnswerListener extends L2JListener
{
	private final int _messageId;
	
	public DlgAnswerListener(int messageId)
	{
		_messageId = messageId;
		register();
	}
	
	public int getMessageId()
	{
		return _messageId;
	}
	
	/**
	 * @param event
	 */
	public abstract void onDlgAnswer(DlgAnswerEvent event);
	
	@Override
	public void register()
	{
		DlgAnswer.addDlgAnswerListener(this);
	}
	
	@Override
	public void unregister()
	{
		DlgAnswer.removeDlgAnswerListener(this);
	}
}
